package com.island.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.island.model.Content;
import com.pollexsoft.base.dao.BaseHibernateDao;

@Repository
public class ContentDao extends  BaseHibernateDao<Content, java.lang.String> {
	
	/**
	 * 查询全部内容
	 * @return
	 */
	public List<Content> findAll(){
		return find("from Content", new Object[]{});
	}
	
	/**
	 * 插入一条内容
	 * @param content
	 */
	public void insertContent(Content content){
		this.insert(content);
	}
	
	/**
	 * 根据ID删除
	 * @param id
	 */
	public void delContent(int id){
		this.delete("delete from Content where content_id=?", id);
	}
	
	/**
	 * 修改内容
	 * @param content
	 */
	public void updateContent(Content content){
		this.update(content);
	}
}
